﻿@namespace AIShell
@inherits LayoutComponentBase

<AntDesign.ProLayout.BasicLayout 
    Logo="@("https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg")"
    MenuData="_menuData">
    <RightContentRender>
        <AIShell.Components.RightContent />
    </RightContentRender>
    <ChildContent>
        @Body
    </ChildContent>
    <FooterRender>
        <FooterView Copyright="2024 许泽宇的技术分享" Links="Links"></FooterView>
    </FooterRender>
</AntDesign.ProLayout.BasicLayout>
<SettingDrawer />

@code
{
    private MenuDataItem[] _menuData = { };

    [Inject] public HttpClient HttpClient { get; set; }

    protected override async Task OnInitializedAsync()
    {
        await base.OnInitializedAsync();
        _menuData = await HttpClient.GetFromJsonAsync<MenuDataItem[]>("data/menu.json");
    }


    public LinkItem[] Links { get; set; } =
    {
        new LinkItem
        {
            Key = "AIShell",
            Title = "AIShell",
            Href = "https://github.com/xuzeyu91/AIShell",
            BlankTarget = true,
        }
    };
}